package com.title4;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Scanner;

/**
 * @Author milian
 * @Date 2021/7/31 0031 20:44
 */
public class title4 {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入身份证号:");
        String number = sc.nextLine();
        FileOutputStream fileOutputStream = new FileOutputStream("code.txt");
        if (number.contains("X")){
            String[] xes = number.split("X");
            number = xes[0]+xes[1];
        }
        String[] split = number.split("");
        for (int i = 0; i < split.length; i++) {
            if (Integer.parseInt(split[i])%2==0){
                fileOutputStream.write(split[i].getBytes());
            }
        }
        fileOutputStream.close();
    }
}
